cmake_minimum_required(VERSION 3.8)
project(test_package CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(CycloneDDS-CXX REQUIRED)

add_executable(test_package test_package.cpp)
target_link_libraries(test_package PRIVATE CycloneDDS-CXX::ddscxx)

if(NOT CMAKE_CROSSCOMPILING)
  IDLCXX_GENERATE(TARGET MessageLib FILES Message.idl)
  add_executable(test_message test_message.cpp)
  target_link_libraries(test_message PRIVATE MessageLib CycloneDDS-CXX::ddscxx)
endif()
